/*
 * exceptions.h
 *
 *  Created on: Mar 20, 2017
 *      Author: hp
 */

#ifndef LIB_MACAROON_EXCEPTIONS_H_
#define LIB_MACAROON_EXCEPTIONS_H_

#include <stdexcept>
namespace macaroons {

class exception: public std::exception {
public:
	exception() {
	}

	explicit exception(const char* message) :
			msg_(message) {
	}

	explicit exception(const std::string& message) :
			msg_(message) {
	}

	virtual ~exception() throw () {
	}

	virtual const char* what() const throw () {
		return msg_.c_str();
	}

protected:
	std::string msg_;
};

class authentication_exception: public exception {
public:
	explicit authentication_exception(const char* message) :
			msg_(message) {
	}

	explicit authentication_exception(const std::string& message) :
			msg_(message) {
	}

	virtual ~authentication_exception() throw () {
	}

	virtual const char* what() const throw () {
		return msg_.c_str();
	}

protected:
	std::string msg_;
};


}

#endif /* LIB_MACAROON_EXCEPTIONS_H_ */
